/**
 * @file main.cpp
 * @author Goodtea
 * @brief 硬币问题
 * 
 */
#include <iostream>
#include <fstream>
#include <string>
#include "coin.h"

using namespace std;

int main()
{
    vector<int> coins = {1, 5, 10, 25};
    int n = coins.size();
    vector<int> MAX(n,INT_MAX);
    int money = 0;

    cout << "请依次输入币值分别为1,5,10,25美分的硬币最大数量: " << endl;
    for (int i = 0; i < n; i++) {
        cout << coins[i] << " 美分: ";
        cin >> MAX[i];
    }
    cout << "请输入要求达到的总金额目标数: ";
    cin >> money;

    int result = coin_change(coins, MAX, n, money);
    if(result == -1){
        cout << "无法凑出目标总金额" << endl;
    }else{
        cout << "总金额为" << money << "时所需硬币总数的最小值为: " << result << endl;
    }

    return 0;
}